Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql: Support additional information "double" datatypes #2293

Merged
merged 1 commit into from Jan 10, 2022

Conversation

nvoxland
Copy link
Contributor

@nvoxland nvoxland commented Dec 22, 2021

Description

Pass along parsed "additional information" information to the final datatype for doubles in mysql/mariadb.

Fixes #2169 which hit the problem with "unsigned"


Dev Handoff Notes (Internal Use)

Links

Testing

Dev Verification

Tested that changeset

<changeSet author="myUser" id="myId1">
        <createTable tableName="double_test">
            <column name="ID" type="CHAR(36)">
                <constraints primaryKey="true"/>
            </column>
            <column name="double_column" type="double(38,2) unsigned"/>
        </createTable>
    </changeSet>

correctly included the "unsigned" and the (38,2) when ran against mysql

Test Requirements (Liquibase Internal QA)

Manual Tests

Verify update-sql generates correct sql code for createTable on MySQL5 database

  • liquibase update-sql --changelog-file lb2195-changelog.xml --labels create
  • CREATE TABLE double_test (unsigned_column DOUBLE(5, 2) unsigned NULL, signed_column DOUBLE(5, 2) signed NULL, zerofill_column DOUBLE(5, 2) zerofill NULL);

Verify update is successful for createTable on MySQL5 database

  • liquibase update --changelog-file lb2195-changelog.xml --labels create
  • update is successful
  • table double_test exists and contains unsigned_column, signed_column and zerofill_column columns
  • mentioned above columns have correct additional information in their data types

Verify update is successful for insert correct data on MySQL5 database

  • liquibase update --changelog-file lb2195-changelog.xml --labels correct,special
  • update is successful
  • data was successfully and correctly inserted into double_test table

Verify update throws an error for insert incorrect data on MySQL5 database

  • liquibase update --changelog-file lb2195-changelog.xml --labels wrong
  • Out of range value is thrown

Repeat all test cases for MySQL8 and MariaDB

Automated Tests

No new functional tests required for this fix.

┆Issue is synchronized with this Jira Bug by Unito

@nvoxland nvoxland added this to To Do in Conditioning++ via automation Dec 22, 2021
@nvoxland nvoxland moved this from To Do to Code Review in Conditioning++ Dec 22, 2021
@suryaaki2 suryaaki2 moved this from Code Review to Ready for Handoff (In JIRA) in Conditioning++ Dec 22, 2021
@nvoxland nvoxland merged commit 491eead into master Jan 10, 2022
Conditioning++ automation moved this from Ready for Handoff (In JIRA) to Done Jan 10, 2022
@nvoxland nvoxland deleted the mysql_double_additional_info branch January 10, 2022 23:04
@nvoxland nvoxland removed this from Done in Conditioning++ Jan 21, 2022
@nvoxland nvoxland added this to the v4.7.1 milestone Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Double unsigned cannot be created in MySQL.
4 participants